#include <gtest/gtest.h>
#include <iostream>
#include <unordered_map>
using namespace std;
unordered_map<string, string> dict;
class MyGlobalTest : public testing::Environment
{
public:
    virtual void SetUp() override
    {
        cout << "测试环境初始化" << endl;
        dict.insert(make_pair("你好", "Hello"));
        dict.insert(make_pair("世界", "World"));
    }
    virtual void TearDown() override
    {
        cout << "测试环境清理" << endl;
    }
};
TEST(MyGlobalTest, test1)
{
    dict.insert(make_pair("红色", "red"));
    ASSERT_EQ(dict.size(), 2);
    cout << "test1 OK" << endl;
}
TEST(MyGlobalTest, test2)
{
    ASSERT_EQ(dict.size(), 3);
    cout << "test2 OK" << endl;
}
TEST(MyGlobalTest, test3)
{
    ASSERT_EQ(dict.size(), 4);
    cout << "test3 OK" << endl;
}
int main(int argc, char *argv[])
{
    testing::AddGlobalTestEnvironment(new MyGlobalTest);
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}